package com.max.eshop.UI.userinterface;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Input {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private Integer input=99;
	private String inputStr;
	private final static String choose = "Vash vibor: ";

	public Integer getInput() {
		return input;
	}

	public void setInput(Integer input) {
		this.input = input;
	}

	public Integer inputInformation() {
		try {
			
			System.out.println(choose);
			 this.setInput(Integer.parseInt(br.readLine()));
		} catch (NumberFormatException | IOException e) {
			System.out.println("ERROR.Vvidite chislo");
		}
		return input;
	}
	public String inputString(){
try {
			
			System.out.println(choose);
			 this.setInputStr(br.readLine());
		} catch (NumberFormatException | IOException e) {
			System.out.println("ERROR.Vvidennie dannie neverni");
		}
		return inputStr;
	}

	public String getInputStr() {
		return inputStr;
	}

	public void setInputStr(String inputStr) {
		this.inputStr = inputStr;
	}
}